package com.dstation.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dstation.domain.*;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

public interface VideoInfoMapper {

    List<VideoInfo> selectAllVideoInfoByExamineStatusAccess();

    boolean insertVideoInfo(@Param("videoInfo") VideoInfo videoInfo);

    boolean insertVideoTagInfo(@Param("tagInfo") TagInfo tagInfo, @Param("videoId") Long videoId, @Param("timestamp") Timestamp timestamp);

    IPage<VideoInfo> selectMyVideo(@Param("iPage") Page iPage, @Param("userId") Long userId);

    String selectVideoCoverageById(@Param("videoId") long videoId);

    String selectVideoNameById(@Param("videoId") long videoId);

    int deleteVideoInfoById(@Param("videoId") long videoId);

    VideoInfo selectVideoInfoById(@Param("videoId") long videoId);

    ClassificationInfo selectClassificationById(@Param("videoClassId") Long videoClassId);

    List<TagInfo> selectTagInfoByVideoId(@Param("videoId") long videoId);

    boolean updateVideoInfo(@Param("videoInfo") VideoInfo videoInfo);

    boolean deleteTagInfoByVideoId(@Param("videoId") Long videoId);

    VideoInfo findVideoDetailInfoById(@Param("videoId") int videoId);

    long findLikedNumByVideoId(@Param("videoId") int videoId);

    VideoLikedInfo selectUserIsPraiseVideoByVideoIdAndUserId(@Param("videoId") int videoId, @Param("userId") Long userId);

    FollowTableInfo findUserIsNoticeUp(@Param("followUserId") Long followUserId, @Param("userId") Long userId);

    List<VideoCommentInfo> selectCommentInfoListByVideoId(@Param("videoId") int videoId);

    CollectionInfo selectUserIsCollectVideoByUserIDAndVideoID(@Param("userId") Long userId, @Param("videoId") int videoId);

    boolean insertHistoryInfo(@Param("historyInfo") HistoryInfo historyInfo);

    boolean updateVideoViewNumByVideoId(@Param("videoId") int videoId);

    CoinOperatedInfo selectUserIsOperatedCoinByVideoAndUserId(@Param("videoId") int videoId,
                                                              @Param("userId") Long userId);
    int selectCoinNumByVideoId(@Param("videoId") long videoId);

    boolean insertUserPraiseVideoInfo(@Param("videoId") int videoId, @Param("userId") Long userId,
                                      @Param("timestamp") Timestamp timestamp);

    boolean deleteUserPraiseVideoInfo(@Param("videoId") int videoId, @Param("userId") Long userId);

    boolean insertUserIsNoticeUpInfo(@Param("followUserId") Long followUserId,
                                     @Param("userId") Long userId, @Param("timestamp") Timestamp timestamp);

    boolean deleteUserIsNoticeUpInfo(@Param("followUserId") Long followUserId, @Param("userId") Long userId);

    List<VideoInfo> selectAllVideoInfoByExamineStatusAccessByUserId(
            @Param("userId") Long userId);

    IPage<VideoInfo> selectAllNotAccessVideoInfo(@Param("videoInfoPage") Page<VideoInfo> videoInfoPage);
}